package com.logistics.controller;

import com.logistics.compont.ResponseApi;
import com.logistics.pojo.Store;
import com.logistics.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/store")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @GetMapping("/queryAllStores")
    public ResponseApi<List<Store>> queryAllStores(){
        List<Store> stores = storeService.queryAllStores();
        return ResponseApi.SUCCESS(stores);
    }

}
